<div style="padding:10px 60px 20px 60px">
    <form id="ff" name="ff" method="post">
        <input  type="hidden" id="id" name="id" value="${sysUser.id!}"/><!-- 在beetl模板中安全输出需要有! -->
        <div style="margin-bottom:20px">
            <label class="label-top">登录名:</label>
            <input class="easyui-textbox" type="text" id="username" name="username" value="${sysUser.username!}" data-options="required:true" style="width:100%;"/>
        </div>
        <div style="margin-bottom:20px">
            <label class="label-top">用户姓名:</label>
            <input id="realname" name="realname" class="easyui-textbox" value="${sysUser.realname!}" type="text" data-options="required:true" style="width:100%;"/>
        </div>
        <div style="margin-bottom:20px">
            <label class="label-top">邮箱:</label>
            <input id="email" name="email" class="easyui-textbox" value="${sysUser.email!}" type="text" data-options="required:true,validType:'email'" style="width:100%;"/>
        </div>
        <div style="margin-bottom:20px">
            <label class="label-top">电话:</label>
            <input id="phone" name="phone" class="easyui-textbox" value="${sysUser.phone!}" type="text" data-options="required:true" style="width:100%;padding:10px;"/>
        </div>
        <div style="margin-bottom:20px">
            <label class="label-top">输入密码:</label>
            <input id="password" name="password" class="easyui-passwordbox" prompt="请输入密码" iconWidth="28" style="width:100%;height:34px;padding:10px">
        </div>
        <div style="margin-bottom:20px">
            <label class="label-top">确认密码:</label>
            <input class="easyui-passwordbox" prompt="请确认密码" iconWidth="28" validType="confirmPass['#password']" style="width:100%;height:34px;padding:10px">
        </div>
        <div id="viewer"></div>
    </form>
    <div style="text-align:center;padding:5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提 交</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清 空</a>
    </div>
</div>
<script>
    //保存表单数据
    function submitForm() {
        $('#ff').form('submit',{
            novalidate:true,
            ajax:true,
            url:'/sysUser/save.html',
            success: function(data) {
                //处理JSON字符串为对象
                var data = $.parseJSON(data);
                if(data.code==200){
                    $.messager.alert('提示信息',data.message,'success');
                    $('#win').window('close');
                    $('#control').panel('refresh');
                }else{
                    $.messager.alert('提示信息',data.message,'error');
                }
            }
        });
    }
    //清除表单数据
    function clearForm() {
        $('#ff').form('clear');
    }
    //密码特效框，装逼用
    $('#password').passwordbox({
        inputEvents: $.extend({}, $.fn.passwordbox.defaults.inputEvents, {
            keypress: function(e){
                var char = String.fromCharCode(e.which);
                $('#viewer').html(char).fadeIn(200, function(){
                    $(this).fadeOut();
                });
            }
        })
    })
</script>
<style>
    #viewer{
        position: relative;
        padding: 0 30px;
        top: -20px;
        font-size: 54px;
        line-height: 60px;
    }
</style>